package com.liudachu.interview.Single;

import com.liudachu.interview.pojo.AoDi;
import com.liudachu.interview.pojo.Bmw;
import com.liudachu.interview.pojo.Car;

/**
 * 工厂模式
 */
public class CarFactory {

	 public static Car createCar(String name) {
		if ("".equals(name)) {
             return null;
		}
		if(name.equals("奥迪")){
			return new AoDi();
		}
		if(name.equals("宝马")){
			return new Bmw();
		}
		return null;
	}
}
